# coding=utf-8
squares = [x**2 for x in range(1, 11)]
print squares
print filter(lambda x: x>=30 and x<=70, squares)

movies = {
	"Monty Python and the Holy Grail": "Great",
	"Monty Python's Life of Brian": "Good",
	"Monty Python's Meaning of Life": "Okay"
}

print movies.items()

threes_and_fives=[x for x in range(1,16) if x%3==0 or x%5==0]

garbled = "!XeXgXaXsXsXeXmX XtXeXrXcXeXsX XeXhXtX XmXaX XI"
message=garbled[::-2]
print message

garbled = "IXXX aXXmX aXXXnXoXXXXXtXhXeXXXXrX sXXXXeXcXXXrXeXt mXXeXsXXXsXaXXXXXXgXeX!XX"
message=filter(lambda x: x!="X", garbled)
print message

def flip_bit(number,n):
    result=0
    mask=1
    mask=mask<<n-1
    print mask
    result=number^mask
    return bin(result)
print flip_bit(15,2)
    